import axios from '../utils/config.js'


//用户登入
/**
 * 
 * @param {Object} data 是一个对象，对象中需要传递username password
 * @returns {Promise}返回是一个promise
 */
export const loginApi = (data = {}) => axios.post("/users/login", data)

//获取验证码

export const getCaptchaApi = () => axios.get("/users/getCaptcha")


//校验验证码
/**
 * 
 * @param {String} captcha 用户输入的验证码 
 * @returns {Promise} 返回一个promise
 */
export const verifyCaptchaApi = captcha=>axios.get("/users/verifyCaptcha",{params:{captcha:captcha}})



//微信登入
export const wechatLoginApi = wechatCode => axios.get("/users/wechatLogin", { params: { wechatCode: wechatCode } })

//获取二维码url
export const getQrcodeApi = sid => axios.get("/users/getQrcode", { params: { sid:sid } })
